package class_and_object.homework;

public class Test_11_3 {
    public static void main(String[] args) {
        Account account = new Account(139, 10000);
        SavingsAccount saccount = new SavingsAccount(5000, 0.0275);
        CheckingAccount caccount = new CheckingAccount(2500, 5000);
        System.out.println("设置id：");
        saccount.setId(123);
        caccount.setId(789);
        System.out.println("储蓄账户的id为：" + saccount.getId());
        System.out.println("支票账户的id为：" + caccount.getId());
        System.out.println("存款：");
        System.out.println("储蓄账户的存款为：" + saccount.getBalance());
        System.out.println("支票账户的存款为：" + caccount.getBalance());
        System.out.println("储蓄账户的月利率为：" + saccount.getInterestRate());
        System.out.println("存储12个月所得利息：" + saccount.getInterest(12));
        System.out.println("存储12个月后存款为：" + saccount.getbalance());
        System.out.println("取款：");
        System.out.println("支票账户取款2000元：");
        caccount.withDraw(3000);
        System.out.println("支票账户取款5200元：");
        caccount.withDraw(4501);
        System.out.println("取款后支票账户余额：" + caccount.getBalance());
        System.out.println(account.toString());
        System.out.println(saccount.toString());
        System.out.println(caccount.toString());
    }
}